pp108 : icons Property

icons Property


Property that contains the collection of icons that can be attached to a tree item. This can be used in place of the icon property under a TreeItem only if there are multiple icons for a Tree Item.

Syntax

XML

<script type="cordys/xml" id=treeSchemaID> 
    <TreeSchema>
        ...
        ...
        ...
        <TreeItem>
            <searchPath>...</searchPath>
            <icons>
                <icon>surl1</icon>
                <icon>surl2</icon>
                <icon>surl3</icon>
                <openIcon>sOpenurl1</openIcon>
            </icons>
            ...
            ...
        </TreeItem>
    </TreeSchema>
</script>


Parameters

Parameter

Description

surl

String that denotes the url path of the image which is an icon for the Tree Item.


Remarks


The icons property can be used when there are more than one icon for a Tree Item. There can be any number of images that can be set for a Tree node or a leaf using this property.

To mention the icons if they are more than one, this property can be used. However, if this is used, then the icon property should not be used outside in the TreeItem. The icon property can come only inside the icons property if there are more than one icon.

The icons from TOP to BOTTOM are displayed in the order of appearance of left to right in the tree node / leaf.

There can be as many as number of icons in the tree node/ leaf but there can be only one openIcon for a Tree item. This open icon will be applied to the left most icon (First icon from the left) in the tree node / leaf. In such cases of specifying the icons and openIcon, the openIcon can be specified either outside the icons or inside the icons.

Example


The following example demonstrates the usage of the property.

<script type="cordys/xml" id="data">
    <data>
        <tuple>
            <old>
                <Employees>
                    <EmployeeID>999</EmployeeID>
                    <FirstName>Nancy</FirstName>
                    <LastName>Davilio</LastName>
                </Employees>
            </old>
        </tuple>
    </data>
</script>
<!-- Schema for tree -->
<script type="cordys/xml" id="schema">
    <TreeSchema>
        <searchPath>//data/tuple/old/</searchPath>
        <Root>
            <description>Employees</description>
        </Root>
        <TreeItem id="EmployeesID">
            <searchPath>Employees</searchPath>
            <description>FirstName</description>
            <icons>
                <icon>/cordys/wcp/images/question.gif</icon>
                <icon>/cordys/wcp/images/refreshicon.gif</icon>
                <openIcon>/cordys/wcp/images/bookopen.gif</openIcon>
           </icons>
        </TreeItem>
    </TreeSchema>
</script>
<!-- tree definition -->
<div cordysType="wcp.library.ui.Tree"  id="sampleTree" treeSchema="schema" treeData="data">
</div>

See Also


tree